package main
import "fmt"
import "errors"
func main(){
	rt, err := chufa(5, 0)
	if err == nil{
		fmt.Println("rt = ", rt)
	}else{
		fmt.Println(err)
	}
	
	rt2, err2 := chufa(5, 2)
	if err2 == nil{
		fmt.Println("rt2 = ", rt2)
	}else{
		fmt.Println(err2)
	}
}

func chufa(a float64, b float64)(rt float64, err error){
	if b == 0{
		err = errors.New("除数不能为0哟")
		return
	}
	return a / b,err
}